﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Customer.aspx.cs" Inherits="Customer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
 

</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<script runat="server">
  protected void btnOk_Click(object sender, EventArgs e)
        {
            //srcNewSubscription.InsertParameters["username"].DefaultValue = Page.User.Identity.Name;
            //srcNewSubscription.InsertParameters["Magid"].DefaultValue = ddlSelectChoice.SelectedValue;
            //srcNewSubscription.InsertParameters["sublength"].DefaultValue = ddlSubscription.SelectedValue;
            //srcNewSubscription.InsertParameters["startdate"].DefaultValue = DateTime.Now.ToString();
            //srcNewSubscription.Insert();
            //lblDisplay.Text = "***********A new subscription for " + ddlSelectChoice.SelectedItem.Text   + " has been added sucessfully***************";
            //lblDisplay.Visible = true; 


            srcAdd.UpdateParameters["title"].DefaultValue = ddlTitle.SelectedItem.Text;
            srcAdd.UpdateParameters["fname"].DefaultValue = txtFName.Text;
            srcAdd.UpdateParameters["lname"].DefaultValue = txtLName.Text;
            srcAdd.UpdateParameters["address"].DefaultValue = txtAddress.Text;
            srcAdd.UpdateParameters["suburb"].DefaultValue = txtSuburb.Text;
            srcAdd.UpdateParameters["postcode"].DefaultValue = txtPostcode.Text;
            srcAdd.UpdateParameters["dayphone"].DefaultValue = txtDaytimePhone.Text;
            srcAdd.Update();
            Response.Redirect("~/Default.aspx");
        }     
</script>
 <script type="text/javascript">

     function displayCalendar() {
         var datePicker = document.getElementById('datePicker');
         datePicker.style.display = 'block';
     }
    
    </script>
<script type="text/javascript">


    function MM_preloadImages() { //v3.0
        var d = document; if (d.images) {
            if (!d.MM_p) d.MM_p = new Array();
            var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
                if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; } 
        }
    }
    function MM_findObj(n, d) { //v4.01
        var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
            d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
        }
        if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
        for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
        if (!x && d.getElementById) x = d.getElementById(n); return x;
    }
    function MM_swapImage() { //v3.0
        var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3)
            if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; }
    }
    function MM_swapImgRestore() { //v3.0
        var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
    }

    function MM_preloadImages() { //v3.0
        var d = document; if (d.images) {
            if (!d.MM_p) d.MM_p = new Array();
            var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
                if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; } 
        }
    }
    function MM_findObj(n, d) { //v4.01
        var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
            d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
        }
        if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
        for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
        if (!x && d.getElementById) x = d.getElementById(n); return x;
    }
    function MM_swapImage() { //v3.0
        var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3)
            if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; }
    }
    function MM_swapImgRestore() { //v3.0
        var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
    }

    function MM_preloadImages() { //v3.0
        var d = document; if (d.images) {
            if (!d.MM_p) d.MM_p = new Array();
            var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
                if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; } 
        }
    }
    function MM_findObj(n, d) { //v4.01
        var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
            d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
        }
        if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
        for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
        if (!x && d.getElementById) x = d.getElementById(n); return x;
    }
    function MM_swapImage() { //v3.0
        var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3)
            if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; }
    }
    function MM_swapImgRestore() { //v3.0
        var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
    }

    function MM_preloadImages() { //v3.0
        var d = document; if (d.images) {
            if (!d.MM_p) d.MM_p = new Array();
            var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
                if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; } 
        }
    }



</script>
 <style type="text/css">
        #datePicker
        {
            display:none;
            position:absolute;
            border:solid 2px black;
            background-color:white;
           
        }
    
    </style>
<style type="text/css">
html
{
  background-image:url('image/back.jpg'); 

    padding:10px;
    color:White;    
  
}
.content
{
    width:950px;
    margin:auto;
        height: 197px;
    }
a
{
 color: white;
 text-decoration:none;

}
a:hover
{
 color: red; 
  text-decoration:none;

}
.link
{
  margin-left:350px; 
     font-weight:bold;
  font-size:large;  
    font-size:x-large;
}
.link2
{
  margin-left:50px; 
     font-weight:bold;
  font-size:large;  
    font-size:x-large;
}
.link3
{
  margin-left:100px; 
     font-weight:bold;

}
.join
{
   background-color:#0099FF;
  clip:auto;
  font-weight:bold;
  font-size:large;
}
.table2
{
 border-style:solid;
   border-color:Black;
   background-color:White;
   color:Black;  
   width:900px; 
}
.row
{
   background-color:Gray;
   color:White;
}
.ticket
{
   background-color:#CC0000;
color:White;

}
ticket.a
{
 color: white;
 text-decoration:none;

}
ticket.a:hover
{
 color: black; 
  text-decoration:none;


}
    .style1
    {
        width: 509px;
    }
    
.footer
{

   margin-top:250px;
}
.border
{
   border:solid 4px White;
    
}
</style>
    <title>Customer</title>
</head>
<body>
    <form id="form1" runat="server">
    <div class="content">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="1000" height="130">
  <param name="movie" value="image/sample.swf?clickTAG=Default.aspx" />
  <param name="quality" value="high" />
  <param name="allowScriptAccess" value="always" />
  <param name="wmode" value="transparent">
     <embed src="sample.swf?clickTAG=Default.aspx"
      quality="high"
      type="application/x-shockwave-flash"
      WMODE="transparent"
      width="1000"
      height="130"
      pluginspage="http://www.macromedia.com/go/getflashplayer"
      allowScriptAccess="always" />
</object>


<asp:HyperLink ID="HyperLink14"  CssClass="link" NavigateUrl="~/Default.aspx" runat="server">Home</asp:HyperLink>
<asp:HyperLink ID="HyperLink1"  CssClass="link2" NavigateUrl="~/Session.aspx" runat="server">Session</asp:HyperLink> <asp:HyperLink ID="HyperLink2" CssClass="link2" NavigateUrl="~/Movie.aspx" runat="server">Movies</asp:HyperLink>
<asp:HyperLink ID="HyperLink3" CssClass="link2"  NavigateUrl="~/Price.aspx" runat="server">Prices</asp:HyperLink>
<asp:HyperLink ID="HyperLink6" CssClass="link2"  NavigateUrl="~/register.aspx" runat="server">Register</asp:HyperLink>
 <br /> <br />
      

 <table >
 <tr><td>Buy Tickets For:  </td> <td>  <asp:Menu
        id="menuTabs"
      StaticMenuItemStyle-BackColor="#333333" 
        StaticMenuItemStyle-Font-Size="Larger"
       DynamicHorizontalOffset="0"   
      DynamicHoverStyle-BackColor="#666666"
        DynamicMenuItemStyle-Width="150px"
       DynamicMenuItemStyle-BackColor="#333333" runat="server">
       <Items>
       <asp:MenuItem
       Text="Cinemas" Selectable="False"  >
     <asp:MenuItem
       Text="Southwestcinema4"
   
        NavigateUrl="~/MovieCinema1.aspx" />
    <asp:MenuItem
      Text="RuralTwinCinemas"
     NavigateUrl="~/MovieCinema2.aspx" />
   </asp:MenuItem>
       </Items>
       </asp:Menu></td><td>&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp&nbsp&nbsp;&nbsp &nbsp&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp</td><td> <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label></td>
<td></asp:Label><asp:Label ID="Label5" runat="server" Text="UserName:" CssClass="link3" ></asp:Label>  <asp:LoginName ID="LoginName2" runat="server" /> &nbsp;&nbsp;&nbsp<asp:HyperLink ID="HyperLink15"   Font-Bold="True" Font-Underline="True" runat="server"  ForeColor="Yellow" />&nbsp;&nbsp;&nbsp
    <asp:LoginStatus ID="LoginStatus1" runat="server" />
    </td>
<td></td>
</tr>
  </table>
   <br />
        <asp:Label ID="Label1" runat="server"></asp:Label>
           <hr /> 
        <asp:BulletedList ID="BulletedList1" runat="server">
            <asp:ListItem Text ="Fill in the contact information form and click submit" />
        </asp:BulletedList><hr />
   <br /> 
       <%--  <% if (User.Identity.IsAuthenticated == true)
            {%> --%>
         
        <table align="center">
	        <tr>
	            <td>
                    <span>Welcome</span> 
                </td>
                <td>
                    <asp:LoginName ID="LoginName1" runat="server" />
                </td>
                <td>
                    
                </td>
            </tr>
         </table>
          
	     <table align="center">
	        <tr>
	            <td>
                    <asp:Label ID="lblTitle" runat="server" Text="Title"></asp:Label> 
                </td>
                <td>
                    <asp:DropDownList ID="ddlTitle"  Width ="128" runat="server">
                        <asp:ListItem Text ="Select" />
                        <asp:ListItem Text ="Mr" />
                        <asp:ListItem Text ="Miss" />
                        <asp:ListItem Text ="Ms" />
                        <asp:ListItem Text ="Mrs" />
                    </asp:DropDownList>
                </td>
                <td colspan ="2">
                    <asp:RequiredFieldValidator ID="reqTitle" ControlToValidate="ddlTitle"  runat="server" InitialValue ="Select" ErrorMessage="(Required)"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblFName" runat="server" Text="First Name"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtFName" Width ="128" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="reqFName" ControlToValidate="txtFName"  runat="server" ErrorMessage="(Required)"></asp:RequiredFieldValidator>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="regFName" ControlToValidate ="txtFName" runat="server" ErrorMessage="(First Name must be alphabetical characters)" ValidationExpression="^[a-zA-Z]*$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblLName" runat="server" Text="Last Name"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtLName" Width ="128" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="reqLName" ControlToValidate="txtLName"  runat="server" ErrorMessage="(Required)"></asp:RequiredFieldValidator>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="regLName" ControlToValidate ="txtLName" runat="server" ErrorMessage="(Last Name must be alphabetical characters)" ValidationExpression="^[a-zA-Z]*$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblAddress" runat="server" Text="Address"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtAddress" Width ="128" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="reqAddress" ControlToValidate="txtAddress"  runat="server" ErrorMessage="(Required)"></asp:RequiredFieldValidator>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="regAddress" ControlToValidate ="txtAddress" runat="server" ErrorMessage="(Address must be in '5 Ann St' format)" ValidationExpression="^[0-9]+\s+([a-zA-Z]+\s[a-zA-Z]+)$"></asp:RegularExpressionValidator>
                </td>
            </tr>
             <tr>
                <td>
                    <asp:Label ID="lblSuburb" runat="server" Text="Suburb"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtSuburb" runat="server" Width ="128" ></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="reqSuburb" runat="server" ErrorMessage="(Required)" ControlToValidate="txtSuburb"></asp:RequiredFieldValidator>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="regSuburb" runat="server" ErrorMessage="(Suburb must be alphabetical characters)" ControlToValidate="txtSuburb" ValidationExpression="^[a-zA-Z]*$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblPostcode" runat="server" Text="Postcode"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtPostcode" runat="server" Width ="128"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="reqPostcode" runat="server" ErrorMessage="(Required)" ControlToValidate="txtPostcode"></asp:RequiredFieldValidator>
                </td>
                <td>
                    <asp:RegularExpressionValidator ID="regPostcode" runat="server" ErrorMessage="(Postcode must be 4 digits)" ControlToValidate="txtPostcode" ValidationExpression="^\d{4}$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblDaytimePhone" runat="server" Text="Daytime Phone"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtDaytimePhone" runat="server" Width ="128"></asp:TextBox>
                </td>
                <td colspan ="2">
                     <asp:RegularExpressionValidator ID="regDaytimePhone" runat="server" ErrorMessage="(Daytime phone must be 10 digits)" ControlToValidate="txtDaytimePhone" ValidationExpression="^\d{10}$"></asp:RegularExpressionValidator>
                </td>
            </tr>
        </table>
        <table align="center">
            <tr>
                <td>
                    <asp:Button ID="btnOk" runat="server"  Text="Submit" CssClass ="Heading"    Width="100px"  
                                            onclick="btnOk_Click"/>
                </td>
            </tr>
        </table>
     <asp:SqlDataSource ID="srcAdd"  runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            
            UpdateCommand="UPDATE Customer SET title =@title,fname=@fname,lname=@lname,address=@address,suburb=@suburb,postcode=@postcode,dayphone=@dayphone WHERE CustomerUserName=@username" 
           >
            <UpdateParameters >
               
                <asp:Parameter Name ="title" Type ="String" />
                <asp:Parameter Name ="fname" Type="String" />
                <asp:Parameter Name ="lname" Type ="String" />
                <asp:Parameter Name ="address" Type="String"  />
                <asp:Parameter Name ="suburb" Type="String"  />
                <asp:Parameter Name ="postcode" Type="Int32"   />
                <asp:Parameter Name ="dayphone" Type="String" />
            <asp:ControlParameter Name ="username" Type ="String" ControlID="label1" />
               
            </UpdateParameters> 
        </asp:SqlDataSource>

	<%--    <%} %>--%>
        
   
  <table width="100" cellpadding="15" class="footer" ><tr><td>Copyright@2012 MovieTix</td><td><asp:HyperLink ID="HyperLink8"  CssClass="footer" NavigateUrl="~/Default.aspx" runat="server">Homepage</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink9"  CssClass="footer" NavigateUrl="~/Default.aspx" runat="server">Session</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink10"  CssClass="footer" NavigateUrl="~/Default.aspx" runat="server">Movies</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink11"  CssClass="footer" NavigateUrl="~/Default.aspx" runat="server">Cinemas</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink12"  CssClass="footer" NavigateUrl="~/Default.aspx" runat="server">Register</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink13"  CssClass="footer" NavigateUrl="~/Default.aspx" runat="server">Log In</asp:HyperLink></td></tr></table>
 </form>
 </body>
</html>
